package com.cdsf.kennedy.hadoop;

import com.cdsf.Application;
import com.cdsf.common.util.HadoopUtil;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;

/**
 * @Author: kennedy
 * @Date: Created in 14:26 2018/4/12
 */
@SpringBootTest(classes = Application.class)
public class hadoop {

    @Test
    public void createFile() {
        HadoopUtil.mkdirs("/api");
    }

    @Test
    public void copyFromLocalFile() {
        //HadoopUtil.copyFromLocalFile("C:\\Users\\kennedy\\Desktop\\10000_access.log", "/api");
        HadoopUtil.copyFromLocalFile("F:\\hadoop000.rar", "/api/big");
    }

    @Test
    public void create() {
        HadoopUtil.create("/api/hello.txt", "hello hadoop");
        HadoopUtil.create("/api/hello.properties", "hello=我和你");
    }

    @Test
    public void cat() {
        //HadoopUtil.cat("/api/hello.txt");
        HadoopUtil.cat("/api/hello.properties");
    }

    @Test
    public void rename() {
        HadoopUtil.rename("/api/hello.txt", "/api/rename.txt");
    }
}
